const Mock = require('mockjs')

module.exports = function generateMocks() {
  return {
    'POST /admin/user/page': Mock.mock({
      code: 0,
      msg: '',
      data: {
        pageIndex: '@integer(1, 10)',
        pageSize: 20,
        total: '@integer(10, 100)',
        'list|10': [
          {
            'id|+1': 1,
            username: '@cname',
            email: '@email',
            email_confirmed: true,
            phone: /^1[34578]\d{9}$/,
            phone_confirmed: true,
            'role|1': ['admin', 'user'],
            created_at: '@datetime',
            createdAt: '@datetime',
            updatedAt: '@datetime',
            updated_at: '@datetime',
            device_id: '@guid',
            birthday: '@date',
            status: '@integer(0, 1)',
            sex: '@integer(0, 1)',
            reg_ip: '@ip',
            avatar: '@image',
          }
        ]
      }
    })
  }
}
